/*
Copyright (C) 2018-2019 de4dot@gmail.com

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#if GAS || INTEL || MASM || NASM
using System;
using System.Collections.Generic;
using Iced.Intel;

namespace Iced.UnitTests.Intel {
	static partial class ToEnumConverter {
		public static bool TryCC_b(string value, out CC_b cc_b) => cc_b_dict.TryGetValue(value, out cc_b);
		public static CC_b GetCC_b(string value) => TryCC_b(value, out var cc_b) ? cc_b : throw new InvalidOperationException($"Invalid CC_b value: {value}");

		static readonly Dictionary<string, CC_b> cc_b_dict =
			// GENERATOR-BEGIN: CC_b_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_b>(3, StringComparer.Ordinal) {
				{ "b", CC_b.b },
				{ "c", CC_b.c },
				{ "nae", CC_b.nae },
			};
			// GENERATOR-END: CC_b_hash

		public static bool TryCC_ae(string value, out CC_ae cc_ae) => cc_ae_dict.TryGetValue(value, out cc_ae);
		public static CC_ae GetCC_ae(string value) => TryCC_ae(value, out var cc_ae) ? cc_ae : throw new InvalidOperationException($"Invalid CC_ae value: {value}");

		static readonly Dictionary<string, CC_ae> cc_ae_dict =
			// GENERATOR-BEGIN: CC_ae_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_ae>(3, StringComparer.Ordinal) {
				{ "ae", CC_ae.ae },
				{ "nb", CC_ae.nb },
				{ "nc", CC_ae.nc },
			};
			// GENERATOR-END: CC_ae_hash

		public static bool TryCC_e(string value, out CC_e cc_e) => cc_e_dict.TryGetValue(value, out cc_e);
		public static CC_e GetCC_e(string value) => TryCC_e(value, out var cc_e) ? cc_e : throw new InvalidOperationException($"Invalid CC_e value: {value}");

		static readonly Dictionary<string, CC_e> cc_e_dict =
			// GENERATOR-BEGIN: CC_e_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_e>(2, StringComparer.Ordinal) {
				{ "e", CC_e.e },
				{ "z", CC_e.z },
			};
			// GENERATOR-END: CC_e_hash

		public static bool TryCC_ne(string value, out CC_ne cc_ne) => cc_ne_dict.TryGetValue(value, out cc_ne);
		public static CC_ne GetCC_ne(string value) => TryCC_ne(value, out var cc_ne) ? cc_ne : throw new InvalidOperationException($"Invalid CC_ne value: {value}");

		static readonly Dictionary<string, CC_ne> cc_ne_dict =
			// GENERATOR-BEGIN: CC_ne_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_ne>(2, StringComparer.Ordinal) {
				{ "ne", CC_ne.ne },
				{ "nz", CC_ne.nz },
			};
			// GENERATOR-END: CC_ne_hash

		public static bool TryCC_be(string value, out CC_be cc_be) => cc_be_dict.TryGetValue(value, out cc_be);
		public static CC_be GetCC_be(string value) => TryCC_be(value, out var cc_be) ? cc_be : throw new InvalidOperationException($"Invalid CC_be value: {value}");

		static readonly Dictionary<string, CC_be> cc_be_dict =
			// GENERATOR-BEGIN: CC_be_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_be>(2, StringComparer.Ordinal) {
				{ "be", CC_be.be },
				{ "na", CC_be.na },
			};
			// GENERATOR-END: CC_be_hash

		public static bool TryCC_a(string value, out CC_a cc_a) => cc_a_dict.TryGetValue(value, out cc_a);
		public static CC_a GetCC_a(string value) => TryCC_a(value, out var cc_a) ? cc_a : throw new InvalidOperationException($"Invalid CC_a value: {value}");

		static readonly Dictionary<string, CC_a> cc_a_dict =
			// GENERATOR-BEGIN: CC_a_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_a>(2, StringComparer.Ordinal) {
				{ "a", CC_a.a },
				{ "nbe", CC_a.nbe },
			};
			// GENERATOR-END: CC_a_hash

		public static bool TryCC_p(string value, out CC_p cc_p) => cc_p_dict.TryGetValue(value, out cc_p);
		public static CC_p GetCC_p(string value) => TryCC_p(value, out var cc_p) ? cc_p : throw new InvalidOperationException($"Invalid CC_p value: {value}");

		static readonly Dictionary<string, CC_p> cc_p_dict =
			// GENERATOR-BEGIN: CC_p_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_p>(2, StringComparer.Ordinal) {
				{ "p", CC_p.p },
				{ "pe", CC_p.pe },
			};
			// GENERATOR-END: CC_p_hash

		public static bool TryCC_np(string value, out CC_np cc_np) => cc_np_dict.TryGetValue(value, out cc_np);
		public static CC_np GetCC_np(string value) => TryCC_np(value, out var cc_np) ? cc_np : throw new InvalidOperationException($"Invalid CC_np value: {value}");

		static readonly Dictionary<string, CC_np> cc_np_dict =
			// GENERATOR-BEGIN: CC_np_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_np>(2, StringComparer.Ordinal) {
				{ "np", CC_np.np },
				{ "po", CC_np.po },
			};
			// GENERATOR-END: CC_np_hash

		public static bool TryCC_l(string value, out CC_l cc_l) => cc_l_dict.TryGetValue(value, out cc_l);
		public static CC_l GetCC_l(string value) => TryCC_l(value, out var cc_l) ? cc_l : throw new InvalidOperationException($"Invalid CC_l value: {value}");

		static readonly Dictionary<string, CC_l> cc_l_dict =
			// GENERATOR-BEGIN: CC_l_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_l>(2, StringComparer.Ordinal) {
				{ "l", CC_l.l },
				{ "nge", CC_l.nge },
			};
			// GENERATOR-END: CC_l_hash

		public static bool TryCC_ge(string value, out CC_ge cc_ge) => cc_ge_dict.TryGetValue(value, out cc_ge);
		public static CC_ge GetCC_ge(string value) => TryCC_ge(value, out var cc_ge) ? cc_ge : throw new InvalidOperationException($"Invalid CC_ge value: {value}");

		static readonly Dictionary<string, CC_ge> cc_ge_dict =
			// GENERATOR-BEGIN: CC_ge_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_ge>(2, StringComparer.Ordinal) {
				{ "ge", CC_ge.ge },
				{ "nl", CC_ge.nl },
			};
			// GENERATOR-END: CC_ge_hash

		public static bool TryCC_le(string value, out CC_le cc_le) => cc_le_dict.TryGetValue(value, out cc_le);
		public static CC_le GetCC_le(string value) => TryCC_le(value, out var cc_le) ? cc_le : throw new InvalidOperationException($"Invalid CC_le value: {value}");

		static readonly Dictionary<string, CC_le> cc_le_dict =
			// GENERATOR-BEGIN: CC_le_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_le>(2, StringComparer.Ordinal) {
				{ "le", CC_le.le },
				{ "ng", CC_le.ng },
			};
			// GENERATOR-END: CC_le_hash

		public static bool TryCC_g(string value, out CC_g cc_g) => cc_g_dict.TryGetValue(value, out cc_g);
		public static CC_g GetCC_g(string value) => TryCC_g(value, out var cc_g) ? cc_g : throw new InvalidOperationException($"Invalid CC_g value: {value}");

		static readonly Dictionary<string, CC_g> cc_g_dict =
			// GENERATOR-BEGIN: CC_g_hash
			// ⚠️This was generated by GENERATOR!🦹‍♂️
			new Dictionary<string, CC_g>(2, StringComparer.Ordinal) {
				{ "g", CC_g.g },
				{ "nle", CC_g.nle },
			};
			// GENERATOR-END: CC_g_hash
	}
}
#endif
